import Editor from 'components/Editor';
import React, { useCallback, useEffect } from 'react';
export default () => {
    const test = useCallback((str: string, c: string) => {
        let length = str.length - 1;
        while (length > 0) {
            length--;
            if (str[length]) {
                break;
            }
        }
        str = str.substr(0, length) + str.substr(length + 1);
        return str;
    }, []);
    useEffect(() => {
        console.log(test('abcdcccba', 'b'));
    }, [test]);

    return (
        <div>
            <div>去除字符串中最后一个指定的字符</div>
            <Editor value={require('./index.md').default} />
        </div>
    );
};
